home *** CD-ROM | disk | FTP | other *** search
- Contents of the source directory of Zed3D.
-
- (C) 1995 by Sébastien Loisel, All Rights Reserved.
-
- CONTENTS This file
- OBJECTS.PRJ Project file for Borland C++ 3.1
- DOSFUNC.H Header file for OS-Specific functions
- XFORMS.H Header file for vector algebra routines
- OBJECTS.C Object management routines
- OBJECTS.H Header file for object management routines
- ZSORT.H Header file for z sorting routines
- TEST.C Test code
- MAKEFILE Makefile for Zortech C++
- DRAWPOLY.H Header file for polygon drawing routine
- DOSFUNC.C OS-Specific functions
- XFORMS.C Vector algebra routines
- ZSORT.C Z sorting routines
- DRAWPOLY.C Polygon drawing routine
- 3DS.C 3-D Studio ASCII file reading routines
- 3DS.H Header file for 3-D Studio ASCII file reading routines
- OBJECTS.EXE Executable test
- DUCK.ASC Sample 3-D Studio ASCII file
-
-
- Some explanations
- =================
-
- This code is not extremely fast, the reason is that it's mostly educational.
- It uses floating point, does not implement all algorithmic optimizations,
- and is pure-C.
-
- Here is for a quick walk-through of the files herein.
-
- XForms.H contains all you need to operate on vectors and matrices. Normally,
- you won't have to tamper with it.
-
- Objects.H is the next step up. Objects.H #includes XForms.H, so if you
- #include <Object.h>, you don't need to #include <XForms.H>. With objects.h,
- you should be able to allocate memory for an object containing faces and
- vertices.
-
- Zsort.H is the next step up, and it #includes <Object.h> so you don't have
- to #include <objects.h>. It implements a radix sort and sorts objects
- front-to-back.
-
- DrawPoly.H is the polygon drawing code. Only one function is of external use,
- the polygon drawing function. All the rest is internal use.
-
- 3DS.H will be very useful to some. It reads a 3-D Studio ASCII file into an
- object, initializing all relevant data, such as normal vectors.
-
-
- TEST.C is the sample code. It's not documented at this time. All test
- routines are labeled test_x, where x is any lowercase letter from a to g
- (I think). Each test routine tests a separate component. As it is now,
- main() calls test_g() and shows a rubber duck. If you want to understand
- how to use this library, examine closely test_g(), read_3ds_file() and
- maybe make_tetrahedron(). This should show you how to use the library.
-
- I am aware that this 3d engine is primitive in a sense, that is, it does
- not implement the texture mapping, gouraud or phong shading, etc... The point,
- however, was to show how a basic 3d engine can be implemented. There are
- quite a few areas where the algorithm is not totally finished. For example,
- the zsort algorithm should have a postprocessing stage to make sure the
- ordering is correct, in some cases clipping the polygons in the process.
- Speaking of clipping polygons, as you will see, this has not been implemented.
- I have not implemented BSP trees, etc, etc, etc...
-
- I hope this code can help you. If it does, please support the shareware
- concept and send your registration (see main text, 3d.doc).
-